package com.blb.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.blb.entity.LaserPrinter;
import com.blb.entity.PrinterDept;
import com.blb.mapper.LaserPrinterMapper;
import com.blb.service.ILaserPrinterService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author tb
 * @since 2020-05-20
 */
@Service
public class LaserPrinterServiceImpl extends ServiceImpl<LaserPrinterMapper, LaserPrinter> implements ILaserPrinterService {

    @Resource
    private LaserPrinterMapper laserPrinterMapper;

    @Override
    public List<PrinterDept> Ilist(Integer start, Integer length,String companyId) {
        return laserPrinterMapper.Ilist(start, length,companyId);
    }

    @Override
    public List<PrinterDept> search(String lpNum,String companyId) {
        return laserPrinterMapper.search(lpNum,companyId);
    }

    /**
     * 查看打印机编号是否存在
     * @param lpNo
     * @return
     */
    @Override
    public int checkLpNo(String lpNo) {
        return laserPrinterMapper.checkLpNo(lpNo);
    }

    /**
     * 查询总数
     * @param companyId
     * @return
     */
    @Override
    public int getCount(String companyId) {
        return laserPrinterMapper.getCount(companyId);
    }
}
